﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

/* Generated with http://xmltocs.com/ */
namespace EDMXParserV1
{
    public class AssociationEnd
    {
        public String Role { get; set; }
        public String Type { get; set; }
        public String Multiplicity { get; set; }

        public OnDelete OnDelete { get; set; }

        public EntityType EntityType { get; set; }

        public static AssociationEnd New(System.Xml.XmlNode Node)
        {
            AssociationEnd AssociationEnd = new AssociationEnd();

            foreach (XmlAttribute Attribute in Node.Attributes)
            {
                switch (Attribute.Name)
                {
                    case "Role":
                        AssociationEnd.Role = Attribute.Value;
                        break;
                    case "Type":
                        AssociationEnd.Type = Attribute.Value;
                        break;
                    case "Multiplicity":
                        AssociationEnd.Multiplicity = Attribute.Value;
                        break;

                    default:
                        Globals.AttributeSwitchCoder(Attribute);
                        break;
                }

            }

            foreach (XmlNode ChildNode in Node.ChildNodes)
            {
                switch (ChildNode.Name)
                {
                    case "OnDelete":
                        OnDelete OnDelete = OnDelete.New( ChildNode);
                        AssociationEnd.OnDelete = OnDelete;
                        break;
                    default:
                        Globals.NodeSwitchCoder(ChildNode);
                        break;
                }
            }

            return AssociationEnd;
        }
    }
}
